/**
 * @Title: Principal.java
 * @Package com.leesche.zcsp.node.web.vo
 * @Description:()
 * @author dennies yang
 * @date 2016年9月27日 下午10:08:27
 * @version V1.0
 */
package com.leesche.zcsp.node.web.vo;

import java.io.Serializable;
import java.util.List;

/**
 * @author dennies yang
 * @version V1.0
 * @Title: Principal.java
 * @Package com.leesche.zcsp.node.web.vo
 * @Description:()
 * @date 2016年9月27日 下午10:08:27
 */
public class Principal implements Serializable {

    private static final long serialVersionUID = 5798882004228239559L;

    private Long userid;
    private Long parentid;
    private String userShortCode;
    private String username;
    private String businessno;
    private Integer Ntype;
    private String openId;
    private String token;
    private Integer loginType;//记录用户登录的入口类型（PC端、微信端、APP端）
    private List<Long> moduleIds;

    public Principal() {
        super();
        // TODO Auto-generated constructor stub
    }

    public Principal(Long userid, Long parentid, String username, String businessno, Integer ntype, String openId, String token, Integer loginType,String userShortCode) {
        this.userid = userid;
        this.parentid = parentid;
        this.username = username;
        this.businessno = businessno;
        Ntype = ntype;
        this.openId = openId;
        this.token = token;
        this.loginType = loginType;
        this.userShortCode = userShortCode;
    }

    public Principal(Long userid, Long parentid, String businessno,
                     String username, Integer ntype, String openid, Integer loginType,String userShortCode) {
        super();
        this.userid = userid;
        this.parentid = parentid;
        this.businessno = businessno;
        this.username = username;
        this.Ntype = ntype;
        this.openId = openid;
        this.loginType = loginType;
        this.userShortCode = userShortCode;
    }

    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

    public Long getParentid() {
        return parentid;
    }

    public void setParentid(Long parentid) {
        this.parentid = parentid;
    }

    public String getBusinessno() {
        return businessno;
    }

    public void setBusinessno(String businessno) {
        this.businessno = businessno;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getNtype() {
        return Ntype;
    }

    public void setNtype(Integer ntype) {
        Ntype = ntype;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    public List<Long> getModuleIds() {
        return moduleIds;
    }

    public void setModuleIds(List<Long> moduleIds) {
        this.moduleIds = moduleIds;
    }

    public Integer getLoginType() {
        return loginType;
    }

    public void setLoginType(Integer loginType) {
        this.loginType = loginType;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUserShortCode() {
        return userShortCode;
    }

    public void setUserShortCode(String userShortCode) {
        this.userShortCode = userShortCode;
    }

    /***
     * @param @param  moduleId
     * @param @return
     * @return boolean
     * @throws
     * @Title: isExistModuleId
     * @Description: TODO(判断权限是否存在)
     */
    public boolean isExistModuleId(Long moduleId) {
        for (Long mid : moduleIds) {
            if (mid == moduleId) {
                return true;
            }
        }
        return false;

    }
}
